package com.yand.optimization.ifelse.way1;

import java.util.HashMap;

public class JudgeRoleContant {

    private static HashMap<String, Role> roleMap = new HashMap<>();

    static{
        roleMap.put("ROLE_ROOT_ADMIN",new RootRole());
        roleMap.put("ROLE_ORDER_ADMIN",new OrderRole());
        roleMap.put("ROLE_NORMAL",new NormalRole());
    }




    public static RoleApter getRoleApter(String roleName){
        RoleApter apter = new RoleApter();
        Role role = roleMap.get(roleName);
        apter.setRole(role);

        return apter;
    }
}
